UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ru1ivN6+oG0ABjbLrGYhgtqF/pQBb8VTLtuEZopwAq0='
WHERE
key_id = '94a820636b223ecbe93124c341a0b8dbf46134db3d530cfbe24009bfbc729c82'
AND (
token = 'Ru1ivN6+oG0ABjbLrGYhgtqF/pQBb8VTLtuEZopwAq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)