UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OWPAf8G8hMNFtPbMGUCaXcsVIxTk3OQ7+wCZn/2bB3E=' 
WHERE 
  key_id = 'b9073a50931d7821ca4dafa7a1eec101790f902d0c9d8f82fa9fc47e0e307b5f' 
  AND (
    token = 'OWPAf8G8hMNFtPbMGUCaXcsVIxTk3OQ7+wCZn/2bB3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021