UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M7JuYEDfLiVrDfBLRkovGEPSRRa6Aqb5yjnJy6KbB/0='
WHERE
key_id = '0e1b46d0382909ddd94e0aa88b537c73300336aee19f50a7b9b6535d4b72e19d'
AND (
token = 'M7JuYEDfLiVrDfBLRkovGEPSRRa6Aqb5yjnJy6KbB/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)