UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OH6WhvJRM9RZtcqXdvJwpMUfxd0dvEDhGK6Je1zlGM4='
WHERE
key_id = 'e1ee6836eacf50c098fdadc10df4f3e27e87577685f9287a7f1316a55588a189'
AND (
token = 'OH6WhvJRM9RZtcqXdvJwpMUfxd0dvEDhGK6Je1zlGM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)