UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fC0giaRzVf9bTK1aGSbb9BEesB/xwS9F//b9hPpsqSQ=' 
WHERE 
  key_id = '959b28f49baf927b50d1ce9bd8101280d511c0ca3f42f74921e15df979750a45' 
  AND (
    token = 'fC0giaRzVf9bTK1aGSbb9BEesB/xwS9F//b9hPpsqSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020