UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/x1C2IjGB3mtnqBA6E/syAS2ma456YBdTELaTLuRUJU='
WHERE
key_id = 'e7d72f5cfd0be82cfe1378705750daca0654ba1018af2d1500dd1fecc1876884'
AND (
token = '/x1C2IjGB3mtnqBA6E/syAS2ma456YBdTELaTLuRUJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)