UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oGgo/j8bk/Lh9Mv60YAZNi+RYJtU/DWHQUSCv1YwNS8=' 
WHERE 
  key_id = 'effd342b217c334e5a2de97001edf8ae778249dca19f834294925bf731f14542' 
  AND (
    token = 'oGgo/j8bk/Lh9Mv60YAZNi+RYJtU/DWHQUSCv1YwNS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034