UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mVMRfj0g9/Y3bsvQm03TCoC9+x9/l/aFzkKyLPqoiD8=' 
WHERE 
  key_id = 'cc5c6214bafb811d5fae668570ac84cb84ae666ecd1d59c8e0266971793d195b' 
  AND (
    token = 'mVMRfj0g9/Y3bsvQm03TCoC9+x9/l/aFzkKyLPqoiD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037