UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6a9n0WWNCZJ81L2X7b1QhkD6fa9H2mHphiV8/YwtLL0=' 
WHERE 
  key_id = '809e14437d6ef5484290da7ab770dac8c78b07588781a7ca0c68da6381351fb4' 
  AND (
    token = '6a9n0WWNCZJ81L2X7b1QhkD6fa9H2mHphiV8/YwtLL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047