UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3F1lMwmzZb5yNHK0HWaqaVgh7khOixdYq56J/sl78h0='
WHERE
key_id = 'dcc50705843c53728a1bda6ca896720073c856fe6223e305a9455fac84dec8ea'
AND (
token = '3F1lMwmzZb5yNHK0HWaqaVgh7khOixdYq56J/sl78h0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)