UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTnPM/2Kuuh1MTuSAcBcMp9hXh/I/GI9NBeqlk+dl4c='
WHERE
key_id = 'aef4d6b818f42f4c1a58f25cdc28d4bd9da140e9477c34ffd6ebde2697c9950e'
AND (
token = 'qTnPM/2Kuuh1MTuSAcBcMp9hXh/I/GI9NBeqlk+dl4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)