UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MIiMW0jGCOvQL5n8pl13P1hy4x91e+bPZsx77dDIObc='
WHERE
key_id = '3779a9d11188a3b6d9e8a1bfdf98e603365783ceb61b9241bd37d477619a685f'
AND (
token = 'MIiMW0jGCOvQL5n8pl13P1hy4x91e+bPZsx77dDIObc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)