UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rWuXABfdGLFhzWCPMoJWL89Ehzvwv7DoPreH2URfX4='
WHERE
key_id = '50194225a1aa7820dfa2b78290d02621e5aa70bafd11ad9ff14c4d13b8379e05'
AND (
token = '3rWuXABfdGLFhzWCPMoJWL89Ehzvwv7DoPreH2URfX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)