UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7NCB3XBXYVNChH5eubxPoQv/OzZa5YU2p4y5ccpPl9I=' 
WHERE 
  key_id = '0232aec314e7590ff4084a9cdf2f26ad859a28fd376d7c194b7d8f31e334145a' 
  AND (
    token = '7NCB3XBXYVNChH5eubxPoQv/OzZa5YU2p4y5ccpPl9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026