UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '28R6sCq95MMfxkD5cnBxKcFGDJrQXgTVZWgw5nnsu84=' 
WHERE 
  key_id = 'd0efdad468b5ee70ac1629f82066b6d8ce90d7716d5a4c73687bb36c327b9b74' 
  AND (
    token = '28R6sCq95MMfxkD5cnBxKcFGDJrQXgTVZWgw5nnsu84=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040