UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u6s83iPBdG7oJDNYTFQbBD/AjE0CX/enEyZec15X/jc=' 
WHERE 
  key_id = '84b27bf54de56001c8785271390347a8cd52f709d09de47b0c94b95208fcbe52' 
  AND (
    token = 'u6s83iPBdG7oJDNYTFQbBD/AjE0CX/enEyZec15X/jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017