UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r+/98Ha6vYRDGDrESw7As9z5GnA00ZGdpBuIUPDaQNE='
WHERE
key_id = '49dfcf8c4e5b82fb1665197a12325d83a5b5948dae28e0695d4486b43f55b39d'
AND (
token = 'r+/98Ha6vYRDGDrESw7As9z5GnA00ZGdpBuIUPDaQNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)