UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwZtVwWLBIZYD7R1OAuN4dGS3KX1KoJQ0GceNerPZNo='
WHERE
key_id = 'cadb09ea13f08b27cc2b46d211c2acbd1f934bd4d743efdce07972c0b0c504c4'
AND (
token = 'UwZtVwWLBIZYD7R1OAuN4dGS3KX1KoJQ0GceNerPZNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)