UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v108i27a9xmBUeS4CTQB1G2Yc6wTrUH40YyQjPmWPso='
WHERE
key_id = '4f50bf911027649b105bd9a1bee57d2e7168d935e29f6b29d18727237af36e6d'
AND (
token = 'v108i27a9xmBUeS4CTQB1G2Yc6wTrUH40YyQjPmWPso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)