UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fBQzkZ3tro+1SRPDKrDRWL6ykDzOIPiie1xR6s8pUE='
WHERE
key_id = '3ee9d8f4dd9c90ecc782b3d24009f1c4d8cd55258cdbc31b8803a3d2c26de9a7'
AND (
token = '3fBQzkZ3tro+1SRPDKrDRWL6ykDzOIPiie1xR6s8pUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)