UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fa8NoDS+C+q55A8x5ySySf95NrfqDdhXivdkFo2X9Ck=' 
WHERE 
  key_id = '7cb251bfe3dd4008ac1a964ee93e5005bec94b2c8d5ada6fdc55f43a068d477c' 
  AND (
    token = 'Fa8NoDS+C+q55A8x5ySySf95NrfqDdhXivdkFo2X9Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015