UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BLsS0rzJUZyOv+Rr6NIt5+cDennlCKDM+Tna1dJ/ZzQ=' 
WHERE 
  key_id = 'e68e07d4ac2ce75354c28a78b09cd2f60e17fddfa7d0439ae6e8a658003d6584' 
  AND (
    token = 'BLsS0rzJUZyOv+Rr6NIt5+cDennlCKDM+Tna1dJ/ZzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051