UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ar3nN0EFIl4L1RoxlBiqJ2AVdHzmzS0MZI5lRmYIiUM='
WHERE
key_id = 'a3442a38ef254820fdcb164bfeb5841a1f4a9c479ad3016719b3a97e7960ae48'
AND (
token = 'Ar3nN0EFIl4L1RoxlBiqJ2AVdHzmzS0MZI5lRmYIiUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)