UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5g79m5oHw7VFV7MWAJQcRf9Lf3KbkaQQYb+23ZzKIVY='
WHERE
key_id = 'ccb2f08a482663e1d5cb129b45e3dc4edc7221ba1e76fe8da9dbb2c221c64034'
AND (
token = '5g79m5oHw7VFV7MWAJQcRf9Lf3KbkaQQYb+23ZzKIVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)