UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DlShLE0GZmV104qIrhGR6sYlb0Javb21GMM9XuuDwxA=' 
WHERE 
  key_id = '80c7b5c80724e0337bc358b2bd4748536a782912fcd416078362534a62d63f04' 
  AND (
    token = 'DlShLE0GZmV104qIrhGR6sYlb0Javb21GMM9XuuDwxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019