UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VEiu5BIvHEV0UgtJ8ejv+LLLEatNq+BlCMMYGNGqTCE='
WHERE
key_id = '621867fd4086050f8484151c2001b2f222d4664f2fd31e278bd84089c4ffab0f'
AND (
token = 'VEiu5BIvHEV0UgtJ8ejv+LLLEatNq+BlCMMYGNGqTCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)