UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YI4VTpVX+2RUZ5/Lz/MVZh+hVYK5GSQIVCjxzqmAJH0='
WHERE
key_id = 'dc31a4f40fc56601d5de6be159ed75278ad14e8d4cba6f5765ab7e8388f4ebbe'
AND (
token = 'YI4VTpVX+2RUZ5/Lz/MVZh+hVYK5GSQIVCjxzqmAJH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)