UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v6bPR1pTPcL8e3GCauKs4Rtgiti/YH5Eya1CMn/f83g='
WHERE
key_id = 'e8a1c85a5b8bf76e6b40b692bde95bfcfe983fa5f3495096f55e183bc1e043e8'
AND (
token = 'v6bPR1pTPcL8e3GCauKs4Rtgiti/YH5Eya1CMn/f83g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)