UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'avoVrbm9SP0ckHFOHzQyuovYO++SUEpdsx0CStsn8Bk=' 
WHERE 
  key_id = '5c8330c39e8bb119efe29e3aacbf44fb441bcffe6bc29c36c9dd13c6d9c496f4' 
  AND (
    token = 'avoVrbm9SP0ckHFOHzQyuovYO++SUEpdsx0CStsn8Bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022