UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lpJ8lGoQ/JnYBAWKnmC4LTQqk9D/owRp1YEbS4pxvJA='
WHERE
key_id = 'ea24cf74d3d9415a3414580733a0dd37d48e6cffa010567fcfb32726bd20e52a'
AND (
token = 'lpJ8lGoQ/JnYBAWKnmC4LTQqk9D/owRp1YEbS4pxvJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)