UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tm2bxs/EISoQR0+fZzcqoK4eC6wR0axuLWcCMlHJVwg='
WHERE
key_id = 'da3ddba1cee924f861badf370c32d22887c8960ca265219219d1d5cb410b0142'
AND (
token = 'Tm2bxs/EISoQR0+fZzcqoK4eC6wR0axuLWcCMlHJVwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)