UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pupp1dYtv6+JD0VylezFMw97j/6SUZMyY+KQg/DWMUo='
WHERE
key_id = 'ea284bf4a278757eb21073498c286a24dd85d0edcec9a61ab1b8be957b1cdca9'
AND (
token = 'Pupp1dYtv6+JD0VylezFMw97j/6SUZMyY+KQg/DWMUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)