UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aJP1lQhaKFTbPVCPkXgTtclzrS/W/lSBUvHuJqKajrE=' 
WHERE 
  key_id = 'db9845f9e1c9868f1397ace1c222aa1b86311d1e3ef86f83b48580e4c4444e7c' 
  AND (
    token = 'aJP1lQhaKFTbPVCPkXgTtclzrS/W/lSBUvHuJqKajrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047