UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a/8kd2jMnzZfRLDN4eOWY7BBbhdfpXAZ/51AuH6Vrb4=' 
WHERE 
  key_id = 'b1cb04c637bfbd669b96539d474e87ff2cfbf6d2daf257c07ec6a2fb30f2a8f1' 
  AND (
    token = 'a/8kd2jMnzZfRLDN4eOWY7BBbhdfpXAZ/51AuH6Vrb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037