UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'guRiPOPNLmlgcHA0njDYBCIJ4YDdhfxpYCYDYuzavzw='
WHERE
key_id = '5ef6951a57a66ebe8fb014d40c2fad81e9825010cda65d75d3287ce6a0078c65'
AND (
token = 'guRiPOPNLmlgcHA0njDYBCIJ4YDdhfxpYCYDYuzavzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)