UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qvuJBSNdfhU6NkpO96Ep0/nmqvRhA4cvebOCfx0SCeU='
WHERE
key_id = '6abeb83492b2be50f0f0635b3bdda1a5f48fb568333e8ad02afa7dda3485e44f'
AND (
token = 'qvuJBSNdfhU6NkpO96Ep0/nmqvRhA4cvebOCfx0SCeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)